
#include "CFDForcePostprocessor.h"
#include "CFDForceUserObject.h"
#include "FEProblem.h"

template<>
InputParameters validParams<CFDForcePostprocessor>()
{
  InputParameters params = validParams<GeneralPostprocessor>();
  params.addPrivateParam<UserObjectName>("cfd_force_user_object");
  params.addPrivateParam <int>("direction");
  return params;
}

CFDForcePostprocessor::CFDForcePostprocessor(const InputParameters &parameters) :
    GeneralPostprocessor(parameters),
    _feproblem(dynamic_cast<FEProblem &>(_subproblem)),
    _cfd_force(getUserObject<CFDForceUserObject>("cfd_force_user_object")),
	_direction(getParam<int>("direction"))
{}

Real CFDForcePostprocessor::getValue()
{
  return _cfd_force._total_force(_direction);
}
